/**
 * @author wly
 * @version V1.0.0
 * @date 2023/3/15 22:06
 */
public class exr01 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i <= 2020; i++) {
            for (int j = 1; j <= i; j++){
                if (judge(i, j) == true){
                    count++;
                }
            }
        }
        System.out.println(2 * count - 1);
    }

    private static boolean judge(int i, int j){
        if (i == 1 || j == 1){
            return true;
        }
        // 此处j 小于 i
        // 非1公约数
        for (int k = 2; k <= j; k++) {
            if (j % k == 0 && i % k == 0){
                return false;
            }
        }
        return true;
    }
}
